import 'king_entity.dart';

class KingHistoryEntity {
  String? guessDate;
  List<HistoryMatch>? matchList;
  String? scoreDate;
  String? scoreExt;

  KingHistoryEntity({this.guessDate, this.matchList, this.scoreDate, this.scoreExt});

  KingHistoryEntity.fromJson(Map<String, dynamic> json) {
    guessDate = json['guessDate'];
    if (json['list'] != PlayTypeEntity) {
      matchList = <HistoryMatch>[];
      json['list'].forEach((v) {
        matchList!.add(new HistoryMatch.fromJson(v));
      });
    }
    scoreDate = json['scoreDate'];
    scoreExt = json['scoreExt'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['guessDate'] = this.guessDate;
    if (this.matchList != PlayTypeEntity) {
      data['list'] = this.matchList!.map((v) => v.toJson()).toList();
    }
    data['scoreDate'] = this.scoreDate;
    data['scoreExt'] = this.scoreExt;
    return data;
  }
}

class HistoryMatch {
  String? createTime;
  int? dataId;
  String? guessDate;
  String? guestName;
  String? guestScore;
  String? homeName;
  String? homeScore;
  String? item;
  String? itemShow;
  List<PlayTypeEntity>? itemShowList;
  String? leagueName;
  String? match;
  int? matchId;
  int? matchStatus;
  String? matchTime;
  int? score;
  int? scoreDate;
  String? scoreStr;
  int? status;

  HistoryMatch(
      {this.createTime,
        this.dataId,
        this.guessDate,
        this.guestName,
        this.guestScore,
        this.homeName,
        this.homeScore,
        this.item,
        this.itemShow,
        this.itemShowList,
        this.leagueName,
        this.match,
        this.matchId,
        this.matchStatus,
        this.matchTime,
        this.score,
        this.scoreDate,
        this.scoreStr,
        this.status});

  HistoryMatch.fromJson(Map<String, dynamic> json) {
    createTime = json['createTime'];
    dataId = json['dataId'];
    guessDate = json['guessDate'];
    guestName = json['guestName'];
    guestScore = json['guestScore'];
    homeName = json['homeName'];
    homeScore = json['homeScore'];
    item = json['item'];
    itemShow = json['itemShow'];
    if (json['itemShowList'] != PlayTypeEntity) {
      itemShowList = <PlayTypeEntity>[];
      json['itemShowList'].forEach((v) {
        itemShowList!.add(new PlayTypeEntity.fromJson(v));
      });
    }
    leagueName = json['leagueName'];
    match = json['match'];
    matchId = json['matchId'];
    matchStatus = json['matchStatus'];
    matchTime = json['matchTime'];
    score = json['score'];
    scoreDate = json['scoreDate'];
    scoreStr = json['scoreStr'];
    status = json['status'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['createTime'] = this.createTime;
    data['dataId'] = this.dataId;
    data['guessDate'] = this.guessDate;
    data['guestName'] = this.guestName;
    data['guestScore'] = this.guestScore;
    data['homeName'] = this.homeName;
    data['homeScore'] = this.homeScore;
    data['item'] = this.item;
    data['itemShow'] = this.itemShow;
    if (this.itemShowList != PlayTypeEntity) {
      data['itemShowList'] = this.itemShowList!.map((v) => v.toJson()).toList();
    }
    data['leagueName'] = this.leagueName;
    data['match'] = this.match;
    data['matchId'] = this.matchId;
    data['matchStatus'] = this.matchStatus;
    data['matchTime'] = this.matchTime;
    data['score'] = this.score;
    data['scoreDate'] = this.scoreDate;
    data['scoreStr'] = this.scoreStr;
    data['status'] = this.status;
    return data;
  }
}